﻿
<div id="best-books">
    <h2>Лучшие книги</h2>
    <ul>
         <% _.each(BestBooks, function(bestBook) { %>
            <li>
                <div class="best-books-content">
                    <a href="@Url.Action(MVC.Books.Index())/<%=bestBook.BookId%>"><img alt="<%=bestBook.Name%>" src="@Url.Content("~/Uploads/")<%=bestBook.Avatar%>" /></a>
                    <h6><a href="@Url.Action(MVC.Books.Index())/<%=bestBook.BookId%>"><%=bestBook.Name%></a></h6>
                    <p><%=bestBook.ShortDescription%></p>
                    <% if(bestBook.IsCanRate) {%>
                        <ul class="star-rating"  data-val-bookId ="<%=bestBook.BookId%>">
                    <%} else { %>
                        <ul class="star-rating disabled">
                    <%}%>
                        <% if(bestBook.Rating==1) {%>
                            <li class="one"></li>
                            <%} else if (bestBook.Rating==2) { %>
                            <li class="two"></li>
                            <%} else if (bestBook.Rating==3) { %>
                            <li class="three"></li>
                            <%} else if (bestBook.Rating==4) { %>
                            <li class="four"></li>
                            <%} else if (bestBook.Rating==5) { %>
                            <li class="five"></li>
                        <%} %>
                        <li><a href="#" data-rate-value="1" title="1 из 5" class="one-star no-link"></a></li>
                        <li><a href="#" data-rate-value="2" title="2 из 5" class="two-stars no-link"></a></li>
                        <li><a href="#" data-rate-value="3" title="3 из 5" class="three-stars no-link"></a></li>
                        <li><a href="#" data-rate-value="4" title="4 из 5" class="four-stars no-link"></a></li>
                        <li><a href="#" data-rate-value="5" title="5 из 5" class="five-stars no-link"></a></li>
                    </ul>
                    <a class="content" href="@Url.Content("~/Uploads/")<%=bestBook.FileName%>">Скачать</a>
                </div>
            </li>
        <% });%>
    </ul>
</div>

<div id="new-books">
    <h2>Новые поступления</h2>
    <ul>
         <% _.each(NewBooks, function(newBook) { %>
            <li>
                <a href="@Url.Action(MVC.Books.Index())/<%=newBook.Id%>"><img  alt="<%=newBook.Name%>" src="@Url.Content("~/Uploads/")<%=newBook.Avatar%>" /></a>
                <h4><a href="@Url.Action(MVC.Books.Index())/<%=newBook.Id%>"><%=newBook.Name%></a></h4>
            </li>
          <% });%>
    </ul>
</div>
